package com.lemontree.spring.aop;

import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.core.annotation.Order;

import java.lang.annotation.Annotation;

@Aspect
public class AspectJTest implements Order{

    @Before("execution(* greetTo(..))")
    public void beforeGreeting(){
        System.out.println("welcome to my rest");
    }

    @AfterReturning(value = "execution(* greetTo(..))",returning = "retValue")
    public void afterAanno(int retValue){
        System.out.println("注解返回..."+retValue);
    }

    @Override
    public int value() {
        return 0;
    }

    @Override
    public Class<? extends Annotation> annotationType() {
        return null;
    }
}
